/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

.ouiDescribedFormGroup {
  max-width: $ouiFormMaxWidth * 2;

  + * {
    margin-top: $ouiSizeL;
  }

  &.ouiDescribedFormGroup--fullWidth {
    max-width: 100%;
  }

  .ouiDescribedFormGroup__description {
    padding-top: $ouiSizeS;
  }

  .ouiDescribedFormGroup__fields {
    min-width: 0; // Needed to support shrinking appropriately with viewport (prevents x-axis content overflow)
  }

  .ouiDescribedFormGroup__fieldPadding {
    &--xxxsmall {padding-top: ($ouiFontSizeXS * 1.5) - $ouiFontSizeXS + 2px;}
    &--xxsmall {padding-top: ($ouiFontSizeS * 1.5) - $ouiFontSizeXS + 2px;}
    &--xsmall {padding-top: ($ouiFontSize * 1.5) - $ouiFontSizeXS + 2px;}
    &--small {padding-top: ($ouiFontSizeL * 1.5) - $ouiFontSizeXS + 2px;}
    &--medium {padding-top: ($ouiFontSizeXL * 1.5) - $ouiFontSizeXS + 2px;}
    &--large {padding-top: ($ouiFontSizeXXL * 1.5) - $ouiFontSizeXS + 2px;}
  }

  @include ouiBreakpoint('xs', 's') {
    .ouiDescribedFormGroup__fields {
      padding-top: 0;

      > .ouiFormRow--hasEmptyLabelSpace:first-child {
        padding-top: 0;
      }
    }
  }
}
